const router = require('koa-router')()
const fs = require('fs')

import Post from '../controller/Post'
import Category from '../controller/Category'
import Sign from '../controller/Sign'
 
router
.prefix('/server')
.get('/sign/set', Sign.set)
.get('/sign/get', Sign.get)

.post('/savePost', Post.savePost)
.post('/saveCategory', Category.saveCategory)
.get('/category',  Category.category)
.get('/findPost', Post.findPost)
.get('/post', Post.post)
// .get('*', async (ctx, next) => {
//     console.log('ssssss')
//    let y = fs.readFileSync('./dist/index.html').toString();
//    console.log(y)
//     ctx.body = y
// })
module.exports = router